﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Entity;
using Localization.Repository.Models;
using System.Data.Entity.Infrastructure;

namespace Localization.Repository
{
    internal class ResourceData : DbContext
    {
        public ResourceData()
        {

        }

        public ResourceData(string connectionString, bool useSqlServer)
            : base(connectionString)
        {
            if (!useSqlServer) {
                //Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe");
                Database.DefaultConnectionFactory =
                    new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
            }

            Database.CreateIfNotExists();
        }

        public DbSet<ResourceCulture> Cutlures { get; set; }
        public DbSet<ResourceClassKey> ClassKeys { get; set; }
        public DbSet<ResourceKey> ResourceKeys { get; set; }
        public DbSet<ResourceValue> ResourceValues { get; set; }
    }
}
